package zhaomh.catgirl;

import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import zhaomh.catgirl.commands.MainCommand;
import zhaomh.catgirl.commands.NekoCommand;
import zhaomh.catgirl.commands.OwnerCommand;
import zhaomh.catgirl.listener.InteractEntityListener;
import zhaomh.catgirl.listener.ChatListener;
import zhaomh.catgirl.listener.JoinListener;


import java.util.Objects;

public class CatGirl extends JavaPlugin {
    public void regCommands() {
        Objects.requireNonNull(getCommand("catgirl")).setExecutor(new MainCommand());
        Objects.requireNonNull(getCommand("neko")).setExecutor(new NekoCommand());
        Objects.requireNonNull(getCommand("owner")).setExecutor(new OwnerCommand());
    }
    public void regListener() {
        Bukkit.getPluginManager().registerEvents(new ChatListener(),this);
        Bukkit.getPluginManager().registerEvents(new InteractEntityListener(),this);
        Bukkit.getPluginManager().registerEvents(new JoinListener(),this);
    }
    @Override
    public void onEnable() {
        // Plugin startup logic
        saveDefaultConfig();
        zConfig.reloadConfig();
        regListener();
        regCommands();
    }
    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }
}
